<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/WEB-INF/webpage/common/taglibs.jspf"%>
<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="sys.param.title" /></title>
    <meta name="decorator" content="form"/> 
</head>

<body class="white-bg"  formid="paramForm">
    <form:form id="paramForm" modelAttribute="data" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<table  class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
		   <tbody>
		       <tr>
		         <td  class="width-15 active text-right">	
		              <label><font color="red">*</font>参数项:</label>
		         </td>
		         <td class="width-35" >
		             <form:input path="code" class="form-control" datatype="*" nullmsg="请输入参数项！" htmlEscape="false" />
		             <label class="Validform_checktip"></label>
		         </td>
		         <td  class="width-15 active text-right">	<label><font color="red">*</font>参数值:</label></td>
		         <td  class="width-35" >
		             <form:input path="value" class="form-control"  htmlEscape="false" nullmsg="请输入参数值！"/>
		             <label class="Validform_checktip"></label>
		         </td>
		      </tr>
		      <tr>
				  <td  class="width-15 active text-right">
					  <label>参数类型:</label>
				  </td>
				  <td class="width-35">
					  <form:select path="paramType" dict="paramType" defaultValue="1" htmlEscape="false" class="form-control" />
				  </td>
				  <td  class="width-15 active text-right">
					  <label>是否停用:</label></td>
				  <td class="width-35">
					  <form:select path="delFlag" dict="sf" defaultValue="0" htmlEscape="false" class="form-control" />
				  </td>
		      </tr>
			   <tr>
				   <td  class="width-15 active text-right">
					   <label><font color="red">*</font>参数描述:</label>
				   </td>
				   <td class="width-35" >
					   <form:input path="description" class="form-control" datatype="*" nullmsg="请输入参数描述！" htmlEscape="false" />
					   <label class="Validform_checktip"></label>
				   </td>
				   <td  class="width-15 active text-right">
					   <label>备注:</label></td>
				   <td  class="width-35" >
					   <form:input path="memo" class="form-control"  htmlEscape="false" />
				   </td>
			   </tr>
		   </tbody>
		</table>   
	</form:form>

<script>
	$(function() {

		// 根据当前时间类型，变化相应的输入框
		if ($("#paramType").val() == "2") {
			$("#value").addClass("layer-date").attr("placeholder", "YYYY-MM-DD hh:mm:ss").attr("onclick", "laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss', value: laydate.now(0, 'YYYY-MM-DD hh:mm:ss')})");
		}

		// 切换字符串以及时间类型时，相应的输入框进行变化
		$("#paramType").change(function() {
			if ($("#paramType").val() == "2") {
				$("#value").val("").addClass("layer-date").attr("placeholder", "YYYY-MM-DD hh:mm:ss").attr("onclick", "laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss', start: laydate.now(0, 'YYYY-MM-DD hh:mm:ss')})");
			}
			else {
				$("#value").val("").removeClass("layer-date").removeAttr("placeholder").removeAttr("onclick");
			}
		})
	})
</script>

</body>
</html>